Skip to content

Update service_create and service_show to optionally return password#50

Merged
nathanjcochran merged 9 commits intomainfrom
nathan/mcp-service-create-password
Oct 10, 2025
Merged

Update service_create and service_show to optionally return password#50
nathanjcochran merged 9 commits intomainfrom
nathan/mcp-service-create-password

Conversation

@nathanjcochran
Copy link
Member

@nathanjcochran nathanjcochran commented Oct 8, 2025

See Slack thread for background.

Updates the service_create and service_show MCP tools to function more like tiger service create and tiger service describe, following the changes made in #32.

Specifically, both MCP tools now return a connection_string field in the response. Additionally, they accept a new with_password parameter, which defaults to false. If set to true, a password field is returned in the response, and the password is also included in the returned connection string. This makes it possible for AI assistants to get access to a service's password and connection string, which was previously not possible via the MCP tools (which made it challenging for AI assistants to connect to a database or configure an application with database credentials).

I also tried to clean up and de-duplicate some repeated code.

Closes AGE-205

@nathanjcochran nathanjcochran self-assigned this Oct 8, 2025
@CLAassistant
Copy link

CLAassistant commented Oct 8, 2025

CLA assistant check
All committers have signed the CLA.

@nathanjcochran nathanjcochran force-pushed the nathan/mcp-service-create-password branch 2 times, most recently from 4b18e04 to 1ac8f86 Compare October 9, 2025 21:09
@nathanjcochran nathanjcochran force-pushed the nathan/mcp-service-create-password branch from 1ac8f86 to ac998a6 Compare October 10, 2025 14:18
type ServiceGetInput struct {
ServiceID string `json:"service_id"`
ServiceID string `json:"service_id"`
WithPassword bool `json:"with_password,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does omitempty do for us on an input type? Does it make it optional?

Copy link
Member Author

@nathanjcochran nathanjcochran Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But this is really just a convention of the github.com/google/jsonschema-go library that github.com/modelcontextprotocol/go-sdk/mcp uses under the hood (for normal JSON unmarshalling, omitempty doesn't have any effect).

See these docs for more info on how jsonschema-go generates JSON schemas from structs. In particular:

Structs have schema type "object", and disallow additionalProperties. Their properties are derived from exported struct fields, using the struct field JSON name. Fields that are marked "omitempty" are considered optional; all other fields become required properties.

@nathanjcochran nathanjcochran merged commit 932fa51 into main Oct 10, 2025
2 of 3 checks passed
@nathanjcochran nathanjcochran deleted the nathan/mcp-service-create-password branch October 10, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants